//
//  LYCompanyCheckMeController.m
//  SelectCity
//
//  Created by liuyan on 2019/3/20.
//  Copyright © 2019年 liuyan. All rights reserved.
//

#import "LYCompanyCheckMeController.h"
#import "LYCompanyCheckMeModel.h"
#import "LYCompanyCheckMeCell.h"

@interface LYCompanyCheckMeController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView *tableview;
@property (nonatomic, strong) NSMutableArray *dataArray;

@end

@implementation LYCompanyCheckMeController

- (NSMutableArray *)dataArray {
    if (!_dataArray) {
        _dataArray = [NSMutableArray array];
        NSArray *array = @[
                           @{@"id":@12312,
                             @"resume_id":@125504,
                             @"userid": @11923,
                             @"name": @"张玲玲",
                             @"avatar": @"",
                             @"sex_cn": @"女",
                             @"age": @25,
                             @"education_cn": @"本科",
                             @"experience_cn": @"3-5年",
                             @"intention_jobs": @"视觉设计师",
                             @"wage_cn": @"20-30K",
                             @"view_time": @1553081265},
                           @{@"id":@12312,
                             @"resume_id":@125504,
                             @"userid": @11923,
                             @"name": @"张玲玲",
                             @"avatar": @"",
                             @"sex_cn": @"女",
                             @"age": @25,
                             @"education_cn": @"本科",
                             @"experience_cn": @"0",
                             @"intention_jobs": @"视觉设计师",
                             @"wage_cn": @"20-30K",
                             @"view_time": @1550648038}
                           ];
        for (NSDictionary *dic in array) {
            LYCompanyCheckMeModel *model = [LYCompanyCheckMeModel mj_objectWithKeyValues:dic];
            [_dataArray addObject:model];
        }
    }
    return _dataArray;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"谁看了我";
    
    [self initUI];
}
- (void)initUI {
    self.tableview = [UIToolsControl initTableViewWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-HeightOfStatusBarAndNavigationBar-SIMEmojKeyBoardkBottomNOSafeArea_Height) target:self style:UITableViewStyleGrouped];
    self.tableview.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableview.backgroundColor = COLOR_OF_WHITE;
    
    [self.tableview registerClass:[LYCompanyCheckMeCell class] forCellReuseIdentifier:kCellIdentifier_LYCompanyCheckMeCell];
    [self.view addSubview:self.tableview];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.dataArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    LYCompanyCheckMeCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_LYCompanyCheckMeCell forIndexPath:indexPath];
    cell.model = self.dataArray[indexPath.section];
    return cell;
}

#pragma mark -- UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 110.0f+10*Scale;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 8;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.001f;
}

@end
